package web

import (
	"gitee.com/banyanhouse/distill-infra/api"
	"gitee.com/banyanhouse/distill-infra/web"
	"gitee.com/banyanhouse/distill-micro-grpc-hystrix/micro-gateway/apis/handler"
	"gitee.com/banyanhouse/distill-micro-grpc-hystrix/micro-gateway/apis/middleware"
)

func init() {
	api.SetupApi(new(ProdsHandler))
}

type ProdsHandler struct {
}

func (c *ProdsHandler) Init() {

}

func (c *ProdsHandler) Setup() {
	mainParty := web.IrisMainParty()
	mainParty.Use(middleware.ProdMiddleware, middleware.ErrorMiddleware)
	// 路由注册
	groupRouter := mainParty.Party("/v1/micro/grpc")
	groupRouter.Post("/prod", handler.ProdHandler)
	groupRouter.Get("/prod/{pid:int}", handler.GetProdDetail)
}
